// EG4PlaHit.h -- a breif definition of the class for plastic scintillators readout
// Created: Jan. 23, 2019, by Asia SUN, asia.rabbit@163.com
// Last Modified: Jan. 30, 2019 by Asia SUN

#ifndef EG4PlaSD_h
#define EG4PlaSD_h

#include "G4VSensitiveDetector.hh"
#include "G4THitsCollection.hh"
#include "EG4PlaHit.h"

using std::string;
using EG4PlaHC = G4THitsCollection<EG4PlaHit>;

class EG4PlaSD : public G4VSensitiveDetector{
public:
  EG4PlaSD(const string &name);
  virtual ~EG4PlaSD();

  // invoked at the beginning of each event
  virtual void Initialize(G4HCofThisEvent *hce);
  // query step info from G4Step
  virtual bool ProcessHits(G4Step *step, G4TouchableHistory *);

protected:
  static const int kNHC = 3;
  EG4PlaHC *fHC[kNHC]; // [0-primaries--1-charged-2ndaries--2-2ndary_neutron]
  int fHCID[kNHC];
};

#endif
